//
//  GameState.m
//  operator
//
//  Created by Andrej on 11.01.12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "GameState.h"

@implementation GameState

@synthesize running, teamId, teamPoints, teamMoney, teams, checkpoints, mapAnnotations;

-(id) init {
    self = [super init];
    if (self) {
        running        = false;
        teamId         = @"N/A";
        mapAnnotations = [[NSMutableDictionary alloc] init];
    }
    return self;
}

-(void) dealloc {
    [teamId release];
    [teams release];
    [checkpoints release];
    [mapAnnotations release];
    [super dealloc];
}

/* Singleton method */
+ (GameState*)defaultState {
    static GameState *_sharedInstance;
    if(!_sharedInstance) {
        static dispatch_once_t oncePredicate;
        dispatch_once(&oncePredicate, ^{
            _sharedInstance = [[super allocWithZone:nil] init];
        });
    }

    return _sharedInstance;
}

@end
